//获取url上的请求参数
function getParams() {
    //获取问号及问号后面的内容
    var url = window.location.search; //?id=10&name=xx&age=xx
    var params = {};
    if (url.indexOf("?") != -1) {
        //截取问号后面的内容,再使用&分割多个属性
        var arr = url.substr(1).split("&");
        for (var i = 0; i < arr.length; i++) {
            //使用=分割为keyvalue
            var keyValue = arr[i].split("=");
            params[keyValue[0]] = keyValue[1]; //{id:10,name:xx,age:xx}
        }
    }
    return params;
}

//判断是否滚到到底部
function isEnd() {
    // 溢出高度 + 屏幕高度 = 网页高度
    // return parseInt($(document).scrollTop())+1 + $(window).height() >= $(document).height();
    var pageHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight);
    var viewportHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;
    var scrollHeight = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
    return pageHeight - viewportHeight - scrollHeight <=0;
}
